<!DOCTYPE html>
<html lang="en">
  <head>
    <title>
        Java-framework-SpringBoot-1 - rulerLwx Blog
      </title>
        <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-transform" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,adress=no">
    
    <meta name="theme-color" content="#000000" />
    
    <meta http-equiv="window-target" content="_top" />
    
    
    <meta name="description" content="知识点 Demo 目录结构： maven： &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt; &amp;lt;project xmlns=&amp;quot;http://maven.apache.org/POM/4.0.0&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xsi:schemaLocation=&amp;quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&amp;quot;&amp;gt; &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt; &amp;lt;groupId&amp;gt;com.itheima&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;springboot&amp;lt;/artifactId&amp;gt; &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt; &amp;lt;parent&amp;gt; &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;spring-boot-starter-parent&amp;lt;/artifactId&amp;gt; &amp;lt;version&amp;gt;2.1.3.RELEASE&amp;lt;/version&amp;gt; &amp;lt;/parent&amp;gt; &amp;lt;dependencies&amp;gt; &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;spring-boot-starter-web&amp;lt;/artifactId&amp;gt; &amp;lt;/dependency&amp;gt; &amp;lt;/dependencies&amp;gt; &amp;lt;/project&amp;gt; 引导类： @SpringBootApplication //表明当前类是SpringBoot的引导类 public class Application {" />
    <meta name="generator" content="Hugo 0.73.0 with theme pure" />
    <title>Java-framework-SpringBoot-1 - rulerLwx Blog</title>
    
    
    <link rel="stylesheet" href="https://rulerLwx.gitee.io/css/style.min.c4bc7071f132c964c2116bca53b392933f377e5ca7b7051ed245187c621a2d3e.css">
    
    <link rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/9.15.10/styles/github.min.css" async>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.css" async>
    <meta property="og:title" content="Java-framework-SpringBoot-1" />
<meta property="og:description" content="知识点 Demo 目录结构： maven： &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.itheima&lt;/groupId&gt; &lt;artifactId&gt;springboot&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;parent&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt; &lt;version&gt;2.1.3.RELEASE&lt;/version&gt; &lt;/parent&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; 引导类： @SpringBootApplication //表明当前类是SpringBoot的引导类 public class Application {" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://rulerLwx.gitee.io/2019/08/java-framework-springboot-1/" />
<meta property="article:published_time" content="2019-08-20T11:11:30+08:00" />
<meta property="article:modified_time" content="2019-08-20T11:11:30+08:00" />
<meta itemprop="name" content="Java-framework-SpringBoot-1">
<meta itemprop="description" content="知识点 Demo 目录结构： maven： &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.itheima&lt;/groupId&gt; &lt;artifactId&gt;springboot&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;parent&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt; &lt;version&gt;2.1.3.RELEASE&lt;/version&gt; &lt;/parent&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; 引导类： @SpringBootApplication //表明当前类是SpringBoot的引导类 public class Application {">
<meta itemprop="datePublished" content="2019-08-20T11:11:30&#43;08:00" />
<meta itemprop="dateModified" content="2019-08-20T11:11:30&#43;08:00" />
<meta itemprop="wordCount" content="4865">



<meta itemprop="keywords" content="" /><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Java-framework-SpringBoot-1"/>
<meta name="twitter:description" content="知识点 Demo 目录结构： maven： &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.itheima&lt;/groupId&gt; &lt;artifactId&gt;springboot&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;parent&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt; &lt;version&gt;2.1.3.RELEASE&lt;/version&gt; &lt;/parent&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; 引导类： @SpringBootApplication //表明当前类是SpringBoot的引导类 public class Application {"/>

    <!--[if lte IE 9]>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
      <![endif]-->

    <!--[if lt IE 9]>
        <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
      <![endif]-->
  </head>

  
  

  <body class="main-center theme-black" itemscope itemtype="http://schema.org/WebPage"><header class="header" itemscope itemtype="http://schema.org/WPHeader">
    <div class="slimContent">
      <div class="navbar-header">
        <div class="profile-block text-center">
          <a id="avatar" href="https://gitee.com/rulerLwx" target="_blank">
            <img class="img-circle img-rotate" src="https://rulerLwx.gitee.io/avatar.png" width="200" height="200">
          </a>
          <h2 id="name" class="hidden-xs hidden-sm">rulerLwx</h2>
          <h3 id="title" class="hidden-xs hidden-sm hidden-md">thinking...</h3>
          <small id="location" class="text-muted hidden-xs hidden-sm"><i class="icon icon-map-marker"></i>Guangzhou, China</small>
        </div><div class="search" id="search-form-wrap">
    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="Search" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat" onclick="return false;"><i
                        class="icon icon-search"></i></button>
            </span>
        </div>
        <div class="ins-search">
            <div class="ins-search-mask"></div>
            <div class="ins-search-container">
                <div class="ins-input-wrapper">
                    <input type="text" class="ins-search-input" placeholder="Type something..."
                        x-webkit-speech />
                    <button type="button" class="close ins-close ins-selectable" data-dismiss="modal"
                        aria-label="Close"><span aria-hidden="true">×</span></button>
                </div>
                <div class="ins-section-wrapper">
                    <div class="ins-section-container"></div>
                </div>
            </div>
        </div>
    </form>
</div>
        <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
      </div>
      <nav id="main-navbar" class="collapse navbar-collapse" itemscope itemtype="http://schema.org/SiteNavigationElement" role="navigation">
        <ul class="nav navbar-nav main-nav">
            <li class="menu-item menu-item-home">
                <a href="/">
                    <i class="icon icon-home-fill"></i>
                  <span class="menu-title">Home</span>
                </a>
            </li>
            <li class="menu-item menu-item-archives">
                <a href="/posts/">
                    <i class="icon icon-archives-fill"></i>
                  <span class="menu-title">Archives</span>
                </a>
            </li>
            <li class="menu-item menu-item-categories">
                <a href="/categories/">
                    <i class="icon icon-folder"></i>
                  <span class="menu-title">Categories</span>
                </a>
            </li>
            <li class="menu-item menu-item-tags">
                <a href="/tags/">
                    <i class="icon icon-tags"></i>
                  <span class="menu-title">Tags</span>
                </a>
            </li>
            <li class="menu-item menu-item-about">
                <a href="/about/">
                    <i class="icon icon-cup-fill"></i>
                  <span class="menu-title">About</span>
                </a>
            </li>
        </ul>
      </nav>
    </div>
  </header>

<aside class="sidebar" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    
      <div class="widget">
    <h3 class="widget-title">Board</h3>
    <div class="widget-body">
        <div id="board">
            <div class="content">enjoy~
            </div>
        </div>
    </div>
</div>

      <div class="widget">
    <h3 class="widget-title"> Categories</h3>
    <div class="widget-body">
        <ul class="category-list">
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/java-framework/" class="category-list-link">java-framework</a><span class="category-list-count">38</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/java-front-end/" class="category-list-link">java-front-end</a><span class="category-list-count">11</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/java-se/" class="category-list-link">java-se</a><span class="category-list-count">21</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/java-senior/" class="category-list-link">java-senior</a><span class="category-list-count">4</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/linux/" class="category-list-link">linux</a><span class="category-list-count">13</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/tools/" class="category-list-link">tools</a><span class="category-list-count">1</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/%E6%8A%80%E6%9C%AF%E6%9D%82%E7%83%A9/" class="category-list-link">技术杂烩</a><span class="category-list-count">4</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/" class="category-list-link">数据库</a><span class="category-list-count">15</span></li>
        </ul>
    </div>
</div>
      <div class="widget">
    <h3 class="widget-title"> Tags</h3>
    <div class="widget-body">
        <ul class="tag-list">
            
            
            <li class="tag-list-item"><a href="https://rulerLwx.gitee.io/tags/jvm/" class="tag-list-link">jvm</a><span
                    class="tag-list-count">1</span></li>
            
            
            <li class="tag-list-item"><a href="https://rulerLwx.gitee.io/tags/%E5%A4%9A%E7%BA%BF%E7%A8%8B/" class="tag-list-link">多线程</a><span
                    class="tag-list-count">2</span></li>
            
            
            <li class="tag-list-item"><a href="https://rulerLwx.gitee.io/tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" class="tag-list-link">网络编程</a><span
                    class="tag-list-count">3</span></li>
            
        </ul>

    </div>
</div>
      
<div class="widget">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget-body">
        <ul class="recent-post-list list-unstyled no-thumbnail">
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E4%B8%80%E6%89%B9%E9%87%8F%E7%A7%BB%E5%8A%A8%E9%87%8D%E5%91%BD%E5%90%8D%E6%96%87%E4%BB%B6/" class="title">自己动手（一）——批量移动、重命名文件</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-27 17:50:02 &#43;0800 CST" itemprop="datePublished">2020-07-27</time>
                    </p>
                </div>
            </li>
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/%E5%85%B3%E4%BA%8Einteger%E7%9A%84-128~127%E7%BC%93%E5%AD%98/" class="title">关于Integer的 -128~127缓存</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-11 16:56:21 &#43;0800 CST" itemprop="datePublished">2020-07-11</time>
                    </p>
                </div>
            </li>
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/%E8%B7%A8%E5%9F%9F%E9%97%AE%E9%A2%98/" class="title">跨域问题</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-08 22:41:12 &#43;0800 CST" itemprop="datePublished">2020-07-08</time>
                    </p>
                </div>
            </li>
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" class="title">个人博客搭建</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-05 18:58:47 &#43;0800 CST" itemprop="datePublished">2020-07-05</time>
                    </p>
                </div>
            </li>
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/mongodb-1/" class="title">MonggoDB-1</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-03 18:58:47 &#43;0800 CST" itemprop="datePublished">2020-07-03</time>
                    </p>
                </div>
            </li>
        </ul>
    </div>
</div>
  </div>
</aside>

    
    
<aside class="sidebar sidebar-toc collapse" id="collapseToc" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    <h4 class="toc-title">Catalogue</h4>
    <nav id="toc" class="js-toc toc">

    </nav>
  </div>
</aside>
<main class="main" role="main"><div class="content">
  <article id="-" class="article article-type-" itemscope
    itemtype="http://schema.org/BlogPosting">
    
    <div class="article-header">
      <h1 itemprop="name">
  <a
    class="article-title"
    href="/2019/08/java-framework-springboot-1/"
    >Java-framework-SpringBoot-1</a
  >
</h1>

      <div class="article-meta">
        
<span class="article-date">
  <i class="icon icon-calendar-check"></i>&nbsp;
<a href="https://rulerLwx.gitee.io/2019/08/java-framework-springboot-1/" class="article-date">
  <time datetime="2019-08-20 11:11:30 &#43;0800 CST" itemprop="datePublished">2019-08-20</time>
</a>
</span>
<span class="article-category">
  <i class="icon icon-folder"></i>&nbsp;
  <a class="article-category-link" href="/categories/java-framework/"> Java-framework </a>
</span>

        <span class="post-comment"><i class="icon icon-comment"></i>&nbsp;<a href="/2019/08/java-framework-springboot-1/#comments"
            class="article-comment-link">Comments</a></span>
		<span class="post-wordcount hidden-xs" itemprop="wordCount">Word Count: 4865words</span>
		<span class="post-readcount hidden-xs" itemprop="timeRequired">Read Count: 10minutes </span>
      </div>
    </div>
    <div class="article-entry marked-body js-toc-content" itemprop="articleBody">
      <h1 id="知识点">知识点</h1>
<h2 id="demo">Demo</h2>
<p>目录结构：</p>
<p><img src="https://oscimg.oschina.net/oscnet/2ce460e38e10ee52024dbf08aa91cf00c78.jpg" alt=""></p>
<p>maven：</p>
<pre><code class="language-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

    &lt;groupId&gt;com.itheima&lt;/groupId&gt;
    &lt;artifactId&gt;springboot&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;

    &lt;parent&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
        &lt;version&gt;2.1.3.RELEASE&lt;/version&gt;
    &lt;/parent&gt;

    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;

&lt;/project&gt;
</code></pre>
<p>引导类：</p>
<pre><code class="language-java">@SpringBootApplication  //表明当前类是SpringBoot的引导类
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
</code></pre>
<p>controller：</p>
<pre><code class="language-java">@RestController
@RequestMapping(&quot;/springmvc&quot;)
public class HelloController {

    @RequestMapping(&quot;/hello&quot;)
    public String sayHello(){
        return &quot;hello spring boot&quot;;
    }
}
</code></pre>
<p>验证：运行Application类的main方法，在浏览器访问：http://localhost:8080/springmvc/hello</p>
<hr>
<p>疑问：导入依赖时，<code>spring-boot-dependencies</code>与<code>spring-boot-start-parent</code>的区别？</p>
<p>总结：在真实的企业级项目，我们可能会有自己的父项目，不想依赖Spring提供的父项目</p>
<p>参考：https://www.cnblogs.com/yaowen/p/8622507.html</p>
<p>示例：</p>
<pre><code class="language-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
    &lt;parent&gt;
        &lt;artifactId&gt;Test202001&lt;/artifactId&gt;
        &lt;groupId&gt;org.example&lt;/groupId&gt;
        &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;/parent&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

    &lt;artifactId&gt;SpringBootTest&lt;/artifactId&gt;

    &lt;dependencyManagement&gt;
        &lt;dependencies&gt;
            &lt;dependency&gt;
                &lt;!-- Import dependency management from Spring Boot --&gt;
                &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
                &lt;version&gt;2.1.3.RELEASE&lt;/version&gt;
                &lt;type&gt;pom&lt;/type&gt;
                &lt;scope&gt;import&lt;/scope&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;

    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
        &lt;/dependency&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;

    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;
&lt;/project&gt;
</code></pre>
<hr>
<h2 id="默认配置">默认配置</h2>
<ul>
<li>SpringBoot默认加载Application所在包（根包）及其子包中的类。</li>
<li>SpringBoot配置：resources下的application.properties文件；</li>
<li>@EnableWebMvc 开启一些默认配置，如ViewResolver或MessageConverter。</li>
</ul>
<h2 id="关闭某一项自动配置">关闭某一项自动配置</h2>
<p>如果我们不需要Spring Boot自动配置，想关闭某一项的自动配置，该如何设置呢？</p>
<p>比如：我们不想自动配置Redis，想手动配置</p>
<pre><code class="language-java">@SpringBootApplication(exclude = {RedisAutoConfiguration.class  })
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class,args);
    }
}
</code></pre>
<p>其它的类推</p>
<h2 id="条件注解">条件注解</h2>
<p>例：org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration是Redis的自动配置</p>
<p><img src="https://oscimg.oschina.net/oscnet/4c8ecc9a9694f458b0c2a5b7484419fae33.jpg" alt="">
<img src="https://oscimg.oschina.net/oscnet/30d118c03f548983cb1d5013c006ca7dbea.jpg" alt="">
<img src="https://oscimg.oschina.net/oscnet/16c46208d9d780b1fd279e3f4c3ff692abb.jpg" alt=""></p>
<h2 id="访问静态资源">访问静态资源</h2>
<p>学习资料：</p>
<ul>
<li><a href="https://ke.qq.com/webcourse/index.html#cid=403245&amp;term_id=100480897&amp;taid=3443636058859309&amp;type=1024&amp;vid=c1432lg3pfz">https://ke.qq.com/webcourse/index.html#cid=403245&amp;term_id=100480897&amp;taid=3443636058859309&amp;type=1024&amp;vid=c1432lg3pfz</a></li>
</ul>
<h3 id="所有的-webjars">所有的 /webjars/**</h3>
<p>所有的 /webjars/**，都去 classpath:/META-INF/resources/webjars/jquery/ 找资源</p>
<p>即：localhost:8080/webjars/jquery/3.3.1/jquery.js，直接访问静态资源 ——20190813</p>
<pre><code class="language-xml">        &lt;dependency&gt;
            &lt;groupId&gt;org.webjars&lt;/groupId&gt;
            &lt;artifactId&gt;jquery&lt;/artifactId&gt;
            &lt;version&gt;3.3.1&lt;/version&gt;
        &lt;/dependency&gt;
</code></pre>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img/20200708100311.png" alt=""></p>
<h3 id="访问任何路径">/**（访问任何路径）</h3>
<p><del>如果进入SpringMVC的规则为/时，Spring Boot的默认静态资源的路径为：</del></p>
<p>默认的静态资源位置：</p>
<p>spring.resources.static-locations=</p>
<ul>
<li>classpath:/META-INF/resources/,</li>
<li>classpath:/resources/,</li>
<li>classpath:/static/,</li>
<li>classpath:/public/</li>
</ul>
<p>例如，在resource下的static目录下文件可以通过浏览器路径直接访问</p>
<p>如：static/img/a.jpg，可以通过 http://localhost:8080/img/a.jpg 访问</p>
<p>将静态资源放置到webapp下的static目录中也可通过地址访问</p>
<p><img src="https://oscimg.oschina.net/oscnet/2414626b61b9dc12db095a842436e7fb13a.jpg" alt=""></p>
<p>测试：</p>
<p><img src="https://oscimg.oschina.net/oscnet/234852832aa8ec0f61e0c93db7355965cc8.jpg" alt=""></p>
<h2 id="自定义消息转化器">自定义消息转化器</h2>
<p>自定义消息转化器，只需要在@Configuration的类中添加消息转化器的@bean加入到Spring容器，就会被Spring Boot自动加入到容器中</p>
<pre><code class="language-java">    @Bean
    public StringHttpMessageConverter stringHttpMessageConverter(){
        StringHttpMessageConverter converter  = new StringHttpMessageConverter(Charset.forName(&quot;UTF-8&quot;));
        return converter;
    }
</code></pre>
<h2 id="自定义springmvc的配置">自定义SpringMVC的配置</h2>
<p>有些时候我们需要自已配置SpringMVC而不是采用默认，比如说增加一个拦截器，这个时候就得通过继承WebMvcConfigurerAdapter然后重写父类中的方法进行扩展。</p>
<pre><code class="language-java">import java.nio.charset.Charset;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration //申明这是一个配置
public class MySrpingMVCConfig extends WebMvcConfigurerAdapter{

    // 自定义拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        HandlerInterceptor handlerInterceptor = new HandlerInterceptor() {
            @Override
            public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
                    throws Exception {
                System.out.println(&quot;自定义拦截器............&quot;);
                return true;
            }
            
            @Override
            public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
                    ModelAndView modelAndView) throws Exception {
                
            }
            
            @Override
            public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,
                    Exception ex) throws Exception {
            }
        };
        registry.addInterceptor(handlerInterceptor).addPathPatterns(&quot;/**&quot;);
    }

    // 自定义消息转化器的第二种方法
    @Override
    public void configureMessageConverters(List&lt;HttpMessageConverter&lt;?&gt;&gt; converters) {
        StringHttpMessageConverter converter  = new StringHttpMessageConverter(Charset.forName(&quot;UTF-8&quot;));
        converters.add(converter);
    }

}
</code></pre>
<p>注意：这个类上不能有@EnableWebMvc，否则就相当于所有的MVC都是我们自己配置，跟自己搭建SSM框架没区别。</p>
<p>参考：https://docs.spring.io/spring-boot/docs/1.5.21.RELEASE/reference/htmlsingle/#boot-features-spring-mvc-auto-configuration</p>
<h2 id="异常处理">异常处理</h2>
<p>定义一个异常类让SpringBoot扫描到即可。</p>
<pre><code class="language-java">@ControllerAdvice
public class GlobleExceptionApp {

    @ExceptionHandler(RuntimeException.class)
    @ResponseBody
    public String runtimeException(){
        return &quot;出现异常，相当于以前的AOP拦截&quot;;
    }
}
</code></pre>
<h2 id="热部署">热部署</h2>
<p>加入依赖包：</p>
<pre><code class="language-xml">        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
        &lt;/dependency&gt;
</code></pre>
<p>启动项目，文件修改后按ctrl+f9重新加载即可实现热部署。</p>
<h2 id="打war包单独发布">打war包单独发布</h2>
<p>1）将工程打包方式改为<code>&lt;packaging&gt;war&lt;/packaging&gt;</code></p>
<p>2）将spring-boot-starter-tomcat的范围设置为<code>provided</code></p>
<pre><code class="language-xml">        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
        &lt;/dependency&gt;
</code></pre>
<p>3）设置启动配置：集成<code>SpringBootServletInitializer</code>，然后重写<code>configure</code>，将Spring Boot的入口类设置进去。</p>
<pre><code class="language-java">public class ServletInitializer extends SpringBootServletInitializer{
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(App.class);
    }
}
</code></pre>
<p>此入口类跟app类放同级目录</p>
<p>注意：访问时带上项目名称，http://localhost:8080/SpringBootTest-1.0-SNAPSHOT/test/hello</p>
<hr>
<p>其原理是：</p>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img/20200708100346.png" alt=""></p>
<p>参考：https://ke.qq.com/webcourse/index.html#cid=403245&amp;term_id=100480897&amp;taid=3443850807224109&amp;type=1024&amp;vid=q1432g6c5v3</p>
<hr>
<p>spring boot 项目打包时，连依赖的jar包一起打包，需要添加一个插件 ——20190623</p>
<pre><code class="language-xml">	&lt;build&gt;
		&lt;plugins&gt;
			&lt;plugin&gt;
				&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
				&lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
			&lt;/plugin&gt;
		&lt;/plugins&gt;
	&lt;/build&gt;
</code></pre>
<h1 id="全局配置文件propertiesyml">全局配置文件：.properties/yml</h1>
<h2 id="文件位置与优先级">文件位置与优先级</h2>
<p>全局的配置文件application.properties/yml，一般在resources目录下或者类路径下的/config下，一般放到resources下</p>
<p>默认配置文件位置加载的优先级从高到低：</p>
<ol>
<li>file:/config/，备注：项目根目录下的config文件夹</li>
<li>file:/</li>
<li>classpath:/config/，备注：resource目录下的config文件夹</li>
<li>classpath:/</li>
<li>或者通过配置spring.config.location来改变默认配置（运维）</li>
</ol>
<p>高级的会覆盖低级的配置，低优先级的也加载，形成<strong>互补配置</strong></p>
<p>编辑application.properties文件，修改或设置全局配置：</p>
<p>项目中同时有application.properties和application.yml文件，哪个优先？</p>
<p>答：两个配置文件都加载，如果有相同的配置，以application.properties配置为准。——20190607</p>
<h2 id="日志">日志</h2>
<p>默认使用的是 SLF4J + logback</p>
<p>可以不另外写日志的配置文件，而在application.properties中做配置，当然另外写一个logback.xml也没问题</p>
<pre><code class="language-properties">#设置日志级别
logging.level.org.springframework=DEBUG

#格式
logging.level.*= # Log levels severity mapping. For instance `logging.level.org.springframework=DEBUG`
</code></pre>
<p>关于日志，参考笔记《Java-Senior-日志》。</p>
<h2 id="profile多环境支持">Profile多环境支持</h2>
<p>作用：多环境支持，开发环境、生产环境</p>
<p>1）在resource目录下可以写多个配置文件</p>
<p>application-[profile].properties/yml，如application-dev.properties，application-product.properties</p>
<p>2）激活profile</p>
<p>方式一：在application.properties中激活profile，启动引导类即可</p>
<pre><code class="language-properties">spring.profiles.active=dev
</code></pre>
<p>方式二：在idea中配置启动参数<code>--spring.profiles.active=eureka1</code></p>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img/20200708100407.png" alt=""></p>
<p>它的原型是<code>java -jar xxxx.jar --spring.profiles.active=dev</code></p>
<p>或配置虚拟机参数<code>-Dspring.profiles.active=dev</code></p>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img/20200708100439.png" alt=""></p>
<p>方式三：在linux上，todo&hellip;</p>
<pre><code>
</code></pre>
<h2 id="配置文件占位符">配置文件占位符</h2>
<p>application.properties配置文件中的属性的值可以是占位符</p>
<p>1）随机数</p>
<pre><code>person.name=${random.value}

${random.int}
${random.long}
${random.int(10)}
${random.int(1024,65536)}
</code></pre>
<p>2）占位符获取之前配置的值，如果没有可以用<code>:</code>指定默认值</p>
<pre><code>person.name=张三
person.dog.name=${person.name:hello}_dog
</code></pre>
<h2 id="写配置文件时有提示">写配置文件时有提示</h2>
<p>添加一个依赖</p>
<pre><code class="language-xml">    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-configuration-processor&lt;/artifactId&gt;
        &lt;optional&gt;true&lt;/optional&gt;
    &lt;/dependency&gt;
</code></pre>
<h2 id="其它常用配置">其它常用配置</h2>
<ul>
<li>修改tomcat端口号</li>
</ul>
<pre><code class="language-properties">server.port = 8088
</code></pre>
<ul>
<li>修改项目访问路径</li>
</ul>
<pre><code class="language-properties">server.context-path=/springboot-demo
</code></pre>
<ul>
<li>应用名称？——20191011</li>
</ul>
<p>这个配置很重要，在分布式微服务中，向外暴露的应用名称 ——20191026</p>
<pre><code>spring.application.name=spring-cloud-mq
</code></pre>
<ul>
<li>修改进入DispatcherServlet的规则为：*.html</li>
</ul>
<pre><code class="language-properties">server.servlet-path = *.html
</code></pre>
<p>参考：</p>
<p><a href="https://blog.csdn.net/m0_37893932/article/details/79665148">https://blog.csdn.net/m0_37893932/article/details/79665148</a>，</p>
<p><a href="https://blog.csdn.net/qq_33802316/article/details/78267336">https://blog.csdn.net/qq_33802316/article/details/78267336</a></p>
<hr>
<p>更多配置：https://docs.spring.io/spring-boot/docs/2.1.4.RELEASE/reference/htmlsingle/#common-application-properties</p>
<h1 id="java配置configuration">Java配置：@Configuration</h1>
<h2 id="importresource加载xml配置文件">@ImportResource：加载xml配置文件</h2>
<p>Spring Boot提倡零配置，但在实际项目中，可能有一些特殊要求你必须使用xml，Spring提供@ImportResource来加载xml配置</p>
<pre><code class="language-java">@ImportResource({&quot;classpath:some-context.xml&quot;,&quot;classpath:another-context.xml&quot;})
</code></pre>
<h2 id="propertysource加载properties文件">@PropertySource：加载properties文件</h2>
<pre><code>
</code></pre>
<h2 id="value字面量spel">@Value(&ldquo;字面量/${}/#{SpEL}&quot;)</h2>
<pre><code class="language-java">    @Value(&quot;${person.username}&quot;)
    private String username;
</code></pre>
<p>相当于<!-- raw HTML omitted -->中的<!-- raw HTML omitted -->的value配置</p>
<pre><code class="language-xml">    &lt;bean class=&quot;&quot;&gt;
        &lt;property name=&quot;&quot; value=&quot;&quot;/&gt;
    &lt;/bean&gt;
</code></pre>
<p>一般配合@PropertySource一起使用，如果没有使用@PropertySource指定文件，默认可以从application.properties中取值</p>
<h2 id="configurationpropertiesprefix">@ConfigurationProperties(prefix=&rdquo;&quot;)</h2>
<p>在application.peroperties/yml文件中配置以person为开头的属性，然后在任何类上使用此注解，就会自动将配置的属性值自动注入到对应属性上</p>
<pre><code>person.username=张三
person.age=24
</code></pre>
<pre><code class="language-java">@Component
@ConfigurationProperties(prefix = &quot;person&quot;)
public class MyConfig {

    private String username;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String toString() {
        return &quot;MyConfig{&quot; +
                &quot;username='&quot; + username + '\'' +
                '}';
    }
}
</code></pre>
<p>@ConfigurationProperties与@Value区别</p>
<table>
<thead>
<tr>
<th>功能</th>
<th>@ConfigurationProperties</th>
<th>@Value</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>批量注入</td>
<td>批量注入配置文件中的属性</td>
<td>一个个指定</td>
<td></td>
</tr>
<tr>
<td>松散绑定（松散语法，大小写）</td>
<td>支持</td>
<td>不支持</td>
<td></td>
</tr>
<tr>
<td>SpEL</td>
<td>不支持</td>
<td>支持</td>
<td></td>
</tr>
<tr>
<td>JSR303校验</td>
<td>支持</td>
<td>不支持</td>
<td>鸡肋-20190607</td>
</tr>
<tr>
<td>复杂类型（如，集合）</td>
<td>支持</td>
<td>不支持</td>
<td></td>
</tr>
</tbody>
</table>
<h2 id="conditionalonxxx">@ConditionalOnxxx</h2>
<p>满足@ConditionalOnxxx指定的条件才进行下一步操作</p>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img/20200708100525.png" alt=""></p>
<p>SpringBoot自动配置时加载的文件在哪里？</p>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img/20200708100540.png" alt=""></p>
<p>如何知道自动配置了哪些东西？在application.properties文件中开启dubug模式：</p>
<pre><code>dubug=true
</code></pre>
<p>效果如下：</p>
<pre><code>============================
CONDITIONS EVALUATION REPORT
============================


Positive matches:
-----------------

   CodecsAutoConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.http.codec.CodecConfigurer' (OnClassCondition)

   CodecsAutoConfiguration.JacksonCodecConfiguration matched:
      - @ConditionalOnClass found required class 'com.fasterxml.jackson.databind.ObjectMapper' (OnClassCondition)



Negative matches:
-----------------

   ActiveMQAutoConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required class 'javax.jms.ConnectionFactory' (OnClassCondition)
</code></pre>
<h1 id="ssm集成">SSM集成</h1>
<p>1)引入jar包</p>
<pre><code class="language-xml">        &lt;dependency&gt;
            &lt;groupId&gt;org.mybatis.spring.boot&lt;/groupId&gt;
            &lt;artifactId&gt;mybatis-spring-boot-starter&lt;/artifactId&gt;
            &lt;version&gt;2.0.0&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;mysql&lt;/groupId&gt;
            &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
        &lt;/dependency&gt;
</code></pre>
<p>2）在application.properties文件配置数据库连接信息</p>
<pre><code class="language-properties">spring.datasource.url=jdbc.mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

mybatis.mapper-locations=classpath:mapper/*.xml
</code></pre>
<p>3）写Mapper接口，接口中写方法名，对应的mapper文件的namespace是Mapper接口的全类名；接口中的方法名跟xml文件中方法的id一致。</p>
<pre><code class="language-java">    @Mapper
    public interface UserMapper {
        List&lt;User&gt; findUserById(Integer id);
    }
</code></pre>
<pre><code class="language-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
&lt;!DOCTYPE mapper PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; &quot;http://mybatis.org/dtd/mybatis-3-mapper.dtd&quot;&gt;
&lt;mapper namespace=&quot;com.demo.boot.dao.UserMapper&quot;&gt;
    &lt;select id=&quot;findUserById&quot; resultType=&quot;com.demo.boot.domain.User&quot;&gt;
        select * from user where id = #{id}
    &lt;/select&gt;
&lt;/mapper&gt;
</code></pre>
<h1 id="thymeleaf">Thymeleaf</h1>
<p>前台模板有Thymeleaf/FreeMark/Groovy，全HTML，相当于静态文件。必须放在 src\main\resources\templates 下，文件夹名称<strong>必须</strong>是 templates，否则需要另行配置；</p>
<p>templates目录是安全的，外界不能直接访问该目录下的文件；参考《Java-framework-SpringBoot-3》。</p>
<p>SpringBoot推荐使用 Thymeleaf</p>
<pre><code class="language-xml">        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
        &lt;/dependency&gt;
</code></pre>
<p>默认的 thymeleaf 版本较低，最好修改 thymeleaf 版本：</p>
<pre><code>    &lt;properties&gt;
        &lt;thymeleaf.version&gt;3.0.2.RELEASE&lt;/thymeleaf.version&gt;
        &lt;thymeleaf-layout-dialect.version&gt;2.0.4&lt;/thymeleaf-layout-dialect.version&gt;
    &lt;/properties&gt;
</code></pre>
<h1 id="q--a">Q &amp; A</h1>
<h2 id="controller与restcontroller的区别">@Controller与@RestController的区别</h2>
<p>@Controller比@RestController多了@ResponsBody注解。因此，@Controller返回页面，@RestController返回JSON格式数据。</p>
<h2 id="jdk版本">jdk版本</h2>
<p>spring-boot-starter-web依赖包含了Spring版本，Spring版本以要求JDK的版本。</p>
<h2 id="mysql数据库连接报错">Mysql数据库连接报错</h2>
<p>Loading class `com.mysql.jdbc.Driver&rsquo;. This is deprecated.</p>
<p>解决办法;</p>
<p>（1）把com.mysql.jdbc.Driver  替换成com.mysql.cj.jdbc.Driver</p>
<p>（2）另外，给JDBC的URL指定时区。</p>
<p>（3）指定SSL是true或者false。</p>
<pre><code class="language-properties">jdbc.DriverClassName=com.mysql.cj.jdbc.Driver
jdbc.url =jdbc:mysql://localhost:3306/student?serverTimezone=UTC&amp;useSSL=false
jdbc.username=root
jdbc.password=root
</code></pre>
<p>参考：https://blog.csdn.net/weixin_42323802/article/details/82589743</p>
<h1 id="附件">附件</h1>
<h2 id="springboot中各种starters依赖">SpringBoot中各种starters依赖</h2>
<p><a href="https://docs.spring.io/spring-boot/docs/2.0.9.RELEASE/reference/htmlsingle/#using-boot-starter">https://docs.spring.io/spring-boot/docs/2.0.9.RELEASE/reference/htmlsingle/#using-boot-starter</a></p>
<h2 id="微服务论文">微服务论文</h2>
<p><a href="https://martinfowler.com/">https://martinfowler.com/</a></p>

    </div>
    <div class="article-footer">
<blockquote class="mt-2x">
  <ul class="post-copyright list-unstyled">
    <li class="post-copyright-link hidden-xs">
      <strong>Permalink: </strong>
      <a href="https://rulerLwx.gitee.io/2019/08/java-framework-springboot-1/" title="Java-framework-SpringBoot-1" target="_blank" rel="external">https://rulerLwx.gitee.io/2019/08/java-framework-springboot-1/</a>
    </li>
    <li class="post-copyright-license">
      <strong>License：</strong><a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN</a>
    </li>
  </ul>
</blockquote>

<div class="panel panel-default panel-badger">
  <div class="panel-body">
    <figure class="media">
      <div class="media-left">
        <a href="https://gitee.com/rulerLwx" target="_blank" class="img-burn thumb-sm visible-lg">
          <img src="https://rulerLwx.gitee.io/avatar.png" class="img-rounded w-full" alt="">
        </a>
      </div>
      <div class="media-body">
        <h3 class="media-heading"><a href="https://gitee.com/rulerLwx" target="_blank"><span class="text-dark">rulerLwx</span><small class="ml-1x">thinking...</small></a></h3>
        <div>Good Good Study, Day Day Up~</div>
      </div>
    </figure>
  </div>
</div>
    </div>
  </article>
<section id="comments">
    <div id="vcomments"></div>
</section>

</div><nav class="bar bar-footer clearfix" data-stick-bottom>
    <div class="bar-inner">
        <ul class="pager pull-left">
            <li class="prev">
                <a href="https://rulerLwx.gitee.io/2019/08/java-framework-spring-data-redis/" title="Java-framework-Spring-Data-Redis"><i
                        class="icon icon-angle-left"
                        aria-hidden="true"></i><span>&nbsp;&nbsp;Older</span></a>
            </li>
            <li class="next">
                <a href="https://rulerLwx.gitee.io/2019/08/java-framework-springboot-2/"
                    title="Java-framework-SpringBoot-2"><span>Newer&nbsp;&nbsp;</span><i
                        class="icon icon-angle-right" aria-hidden="true"></i></a>
            </li>
            
            <li class="toggle-toc">
                <a class="toggle-btn collapsed" data-toggle="collapse" href="#collapseToc" aria-expanded="false"
                    title="Catalogue" role="button">
                    <span>[&nbsp;</span><span>Catalogue</span>
                    <i class="text-collapsed icon icon-anchor"></i>
                    <i class="text-in icon icon-close"></i>
                    <span>]</span>
                </a>
            </li>
        </ul>
        <div class="bar-right">
            <div class="share-component" data-sites="weibo,qq,wechat"
                data-mobile-sites="weibo,qq,qzone"></div>
        </div>
    </div>
</nav>

</main><footer class="footer" itemscope itemtype="http://schema.org/WPFooter">
<ul class="social-links">
    <li><a href="https://gitee.com/rulerLwx" target="_blank" title="gitee" data-toggle=tooltip data-placement=top >
            <i class="icon icon-gitee"></i></a></li>
    <li><a href="https://github.com/wolf-lea" target="_blank" title="github" data-toggle=tooltip data-placement=top >
            <i class="icon icon-github"></i></a></li>
</ul>
  <div class="copyright">
    &copy;2017  -
    2020
    <div class="publishby">
        Theme by <a href="https://github.com/xiaoheiAh" target="_blank"> xiaoheiAh </a>base on<a href="https://github.com/xiaoheiAh/hugo-theme-pure" target="_blank"> pure</a>.
    </div>
  </div>
</footer>

<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_SVG"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
            showMathMenu: false, //disables context menu
            tex2jax: {
            inlineMath: [ ['$','$'], ['\\(','\\)'] ]
           }
    });
</script>


<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
<script>
    window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>
<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/highlight.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/python.min.js" defer></script>
<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/javascript.min.js" defer></script><script>
    hljs.configure({
        tabReplace: '    ', 
        classPrefix: ''     
        
    })
    hljs.initHighlightingOnLoad();
</script>
<script src="https://rulerLwx.gitee.io/js/application.min.bdeb64b910570b6c41badc6a05b7afb0c8ad9efd8525de3c7257d59e786326a3.js"></script>
<script src="https://rulerLwx.gitee.io/js/plugin.min.51ff8c7317566f82259170fa36e09c4493adc9b9378b427a01ad3f017ebac7dd.js"></script>

<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: 'Posts',
                PAGES: 'Pages',
                CATEGORIES: 'Categories',
                TAGS: 'Tags',
                UNTITLED: '(Untitled)',
            },
            ROOT_URL: 'https:\/\/rulerLwx.gitee.io',
            CONTENT_URL: 'https:\/\/rulerLwx.gitee.io\/searchindex.json ',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script type="text/javascript" src="https://rulerLwx.gitee.io/js/insight.min.a343cd9a5a7698336b28ef3a7c16a3a1b1d2d5fb17dc8ed04022bbe08cc5459073a15bdafa3a8a58cdd56080784bdd69fa70b1ae8597565c799c57ed00f0e120.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.min.js"></script>
<script>
    tocbot.init({
        
        tocSelector: '.js-toc',
        
        contentSelector: '.js-toc-content',
        
        headingSelector: 'h1, h2, h3',
        
        hasInnerContainers: true,
    });
</script>

<script src="https://cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine"></script>
<script type="text/javascript">
    var GUEST = ['nick', 'mail', 'link'];
    var meta = 'nick,mail';
    meta = meta.split(',').filter(function (item) {
        return GUEST.indexOf(item) > -1;
    });
    new Valine({
        el: '#vcomments',
        verify: null ,
        notify: null ,
        appId: 'IyAB0PSPRazTPDxitO1ddQ7O-gzGzoHsz',
        appKey: '5rBJTq4KidYF33eXwvRVhtEH',
        placeholder: 'enjoy~',
        avatar: 'mm',
        meta: meta,
        pageSize: '10' || 10,
        visitor: false 
});
</script>

  </body>
</html>
